#1.Ensure that the spadmin and sptimer services are running by opening a command prompt and typing the following commands.
net start spadminv4
net start sptimerv4

# Gets the name of the managed account and sets it to the variable $account for later use.
$account = Get-SPManagedAccount "contoso\spsvc" 

# Creates an application pool for the Subscription Settings service application. 
# Uses a managed account as the security account for the application pool.
# Stores the application pool as a variable for later use.
$appPoolSubSvc = New-SPServiceApplicationPool -Name SubscriptionSettingsServiceApplicationPool -Account $account

# Creates the Subscription Settings service application, using the variable to associate it with the application pool that was created earlier.
# Stores the new service application as a variable for later use.
$appSubSvc = New-SPSubscriptionSettingsServiceApplication -ApplicationPool $appPoolSubSvc -Name "Subscription Settings Service Application" -DatabaseName "SubscriptionSettingsService_6e014b54-bc96-428c-8155-8802c7113957"

# Creates a proxy for the Subscription Settings service application.
$proxySubSvc = New-SPSubscriptionSettingsServiceApplicationProxy -ServiceApplication $appSubSvc